#ifndef MSG_GFXGETGRAPHICSENTITIES_H
#define MSG_GFXGETGRAPHICSENTITIES_H
//------------------------------------------------------------------------------
/**
    @class GraphicsFeature::GfxGetGraphicsEntities

    Returns the graphics entities used by a game entity for rendering.

    (C) 2007 Radon Labs GmbH
*/
#include "messaging/message.h"
#include "graphics/graphicsentity.h"

//------------------------------------------------------------------------------
namespace GraphicsFeature
{
class GfxGetGraphicsEntities : public Messaging::Message
{
    DeclareClass(GfxGetGraphicsEntities);
    DeclareMsgId;
public:
    /// set graphics entities array
    void SetEntities(const Util::Array<Ptr<Graphics::GraphicsEntity>>& e);
    /// set a single graphics entity
    void SetEntity(const Ptr<Graphics::GraphicsEntity>& e);
    /// get graphics entities array
    const Util::Array<Ptr<Graphics::GraphicsEntity>>& GetEntities() const;

private:
    Util::Array<Ptr<Graphics::GraphicsEntity>> entities;
};

//------------------------------------------------------------------------------
/**
*/
inline void
GfxGetGraphicsEntities::SetEntities(const Util::Array<Ptr<Graphics::GraphicsEntity>>& e)
{
    this->entities = e;
}

//------------------------------------------------------------------------------
/**
*/
inline void
GfxGetGraphicsEntities::SetEntity(const Ptr<Graphics::GraphicsEntity>& e)
{
    n_assert(0 != e);
    this->entities.Clear();
    this->entities.Append(e);
}

//------------------------------------------------------------------------------
/**
*/
inline const Util::Array<Ptr<Graphics::GraphicsEntity>>&
GfxGetGraphicsEntities::GetEntities() const
{
    return this->entities;
}

} // namespace GraphicsFeature
//------------------------------------------------------------------------------
#endif

